Skip to content

🚧 feat: chatbot v0#848

Draft
kaljarv wants to merge 13 commits intomainfrom
feat-chatbot-v0
Draft

🚧 feat: chatbot v0#848
kaljarv wants to merge 13 commits intomainfrom
feat-chatbot-v0

Conversation

@kaljarv
Copy link
Contributor

@kaljarv kaljarv commented Jan 25, 2026

WHY:

Introduces a WIP version of the chatbot.

Rebased on main on 28 Jan 2026 (commit f5684c9).

What has been changed (if possible, add screenshots, gifs, etc. )

Check off each of the following tasks as they are completed

  • I have reviewed the changes myself in this PR. Please check the self-review document
  • I have added or edited unit tests.
  • I have run the unit tests successfully.
  • I have run the e2e tests successfully.
  • I have tested this change on my own device.
  • I have tested this change on other devices (Using Browserstack is recommended).
  • I have tested my changes using the WAVE extension
  • I have tested my changes using keyboard navigation and screen-reading
  • I have added documentation where necessary.
  • Is there an existing issue linked to this PR?
  • I have cleaned up the commit history and checked the commits follow the guidelines

Copilot AI review requested due to automatic review settings January 25, 2026 12:04
@kaljarv kaljarv marked this pull request as draft January 25, 2026 12:04
@kaljarv kaljarv mentioned this pull request Jan 25, 2026
11 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a work-in-progress chatbot feature for the voting advice application, representing a significant expansion of functionality across multiple packages.

Changes:

  • Added a new @openvaa/chatbot package containing core chatbot logic, RAG services, and conversation management
  • Implemented admin app infrastructure with job monitoring, argument condensation, and question info generation features
  • Refactored LLM-related packages to use a new @openvaa/llm-refactor architecture
  • Added Redis-based conversation state management and rate limiting
  • Introduced new UI components for chatbot widgets, hero images, and admin job monitoring

Reviewed changes

Copilot reviewed 287 out of 498 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/chatbot/package.json Defines dependencies and build configuration for the new chatbot package
packages/chatbot/HANDOFF.md Documents TODOs and technical debt for future chatbot development
packages/argument-condensation/* Refactored to use llm-refactor package and updated type definitions
packages/app-shared/src/settings/* Extended settings types to support admin app and new hero content
frontend/src/routes/[[lang=locale]]/admin/* New admin app routes and components for job management
frontend/src/routes/[[lang=locale]]/api/* New API routes for authentication, chat, and admin job management
frontend/src/lib/components/chatbot/* New chatbot UI components including widget and toggle button
frontend/src/lib/components/hero/* New hero component supporting both emoji and image content
frontend/src/lib/server/redis/* Redis client and stores for conversation state and rate limiting
backend/vaa-strapi/src/api/admin-job/* New Strapi collection type for persisting admin job results
backend/vaa-strapi/src/policies/user-is-admin.ts New policy to restrict admin-only routes
docker-compose.dev.yml Added Redis service configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"build:cjs": "yarn package:cjs && yarn exec tsc --build tsconfig.cjs.json",
"build:esm": "yarn package:esm && yarn exec tsc --build tsconfig.esm.json",
"build": "yarn build:cjs && yarn build:esm",
"build": "yarn tsc --build && yarn tsc-esm-fix && mkdir -p build/core/condensation/prompts && find src/core/condensation/prompts -mindepth 1 -maxdepth 1 -type d -exec cp -R {} build/core/condensation/prompts/ \\;",
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build command contains complex shell logic with escaped characters. Consider moving this to a separate build script file (e.g., scripts/build.sh) for better maintainability and cross-platform compatibility.

Suggested change
"build": "yarn tsc --build && yarn tsc-esm-fix && mkdir -p build/core/condensation/prompts && find src/core/condensation/prompts -mindepth 1 -maxdepth 1 -type d -exec cp -R {} build/core/condensation/prompts/ \\;",
"build": "bash ./scripts/build-argument-condensation.sh",

Copilot uses AI. Check for mistakes.
REFINE: 'Refine',
GROUND: 'Ground',
ROOT: 'Root',
EMPTY: '?'
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing emoji icons with text labels reduces visual clarity in the visualization tool. Consider keeping emojis for better user experience or making this configurable.

Suggested change
EMPTY: '?'
EMPTY: ''

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +48
$: canSubmit = status !== 'loading' && registrationKey !== '' && (status !== 'error' || changedAfterCheck);
$: {
// Mark the input field as changed so we re-enable the submit button without hiding the error message
changedAfterCheck = true;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
registrationKey;
}
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reactive statement with an unused expression and eslint-disable comment is a code smell. Consider using a more explicit approach, such as an on:input handler on the registration key input field to set changedAfterCheck = true.

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +17
maxRequests = 20, // 20 requests
windowSeconds = 60 // per 60 seconds
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Magic numbers for rate limiting are hardcoded in constructor defaults. Consider defining these as named constants (e.g., DEFAULT_MAX_REQUESTS, DEFAULT_WINDOW_SECONDS) for better maintainability.

Copilot uses AI. Check for mistakes.
params,
request
}: StrapiContext): Promise<Data.ContentType<'api::question.question'>> {
console.error({ params });
Copy link

Copilot AI Jan 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug console.error statement should be removed before merging to production. Use proper logging or remove this line.

Suggested change
console.error({ params });

Copilot uses AI. Check for mistakes.
maximusvitutus and others added 13 commits January 28, 2026 20:25
- typing for source segments
- vector store interface & concrete Chroma implementation
- text embedder interface & concrete OpenAI implementation
- local file system for saving analyzed segments
- reranking utility function using Cohere
- it is expected that main will contain the latest llm package
- this should thus not mess with commit history of the main branch
… logic for documents

- metadata extraction is done for full documents
- fact extraction & summarization is done for each segment in the document
- processText is a subset of processPdf
- only difference is pdf extraction step
- handles metadata extraction, segmentation, fact extraction and segment summaries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants